package com.daxiong.pattern.singleton;

/**
 * 模拟取快递
 *
 * @author sunyanxiong
 * @date 2017/4/23
 */
public class Person {

    private static Person person = new Person();

    private Person() {
    }

    // 取快递的次数
    private int count = 0;

    public static Person getPerson() {
        return person;
    }

    public synchronized String getAnswer() {
        return "我是王小华，这是我的第 " + (++count) + " 快递";
    }

}
